-
Notifications
You must be signed in to change notification settings - Fork 571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add high-level locations to sierra error. #7074
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)
crates/cairo-lang-sierra-to-casm/src/annotations.rs
line 110 at r1 (raw file):
} res.push(*destination_statement_idx); res
.
Suggestion:
chain!([*source_statement_idx, *destination_statement_idx],
introduction_point.source_statement_idx).collect()
96742ed
to
c193719
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 5 files reviewed, 1 unresolved discussion (waiting on @orizi)
crates/cairo-lang-sierra-to-casm/src/annotations.rs
line 110 at r1 (raw file):
Previously, orizi wrote…
.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)
crates/cairo-lang-executable/src/compile.rs
line 169 at r2 (raw file):
anyhow::bail!("Failed to create runnable builder: {}\n{}", err, locs.join("\n")); } };
Suggestion:
let builder = match RunnableBuilder::new(sierra_program, None).map_err(|err| {
let mut locs = vec![];
for stmt_idx in err.stmt_indices() {
if let Some(loc) = debug_info
.statements_locations
.locations
.get(&stmt_idx)
.and_then(|stmt_locs| stmt_locs.first())
{
locs.push(format!("#{stmt_idx} {:?}", loc.diagnostic_location(db).debug(db)))
}
}
anyhow::anyhow!("Failed to create runnable builder: {}\n{}", err, locs.join("\n"));
};
c193719
to
a06740f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)
a06740f
to
6bd1bbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)
6bd1bbd
to
783083a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: 4 of 5 files reviewed, 1 unresolved discussion (waiting on @ilyalesokhin-starkware)
crates/cairo-lang-executable/src/compile.rs
line 158 at r5 (raw file):
// Note that the `last` is used here as the call site is the most relevant location. if let Some(loc) = debug_info
Suggestion:
for stmt_idx in err.stmt_indices() {
// Note that the `last` is used here as the call site is the most relevant location.
if let Some(loc) = debug_info
783083a
to
3ad7f0a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 5 files reviewed, 1 unresolved discussion (waiting on @orizi)
crates/cairo-lang-executable/src/compile.rs
line 158 at r5 (raw file):
// Note that the `last` is used here as the call site is the most relevant location. if let Some(loc) = debug_info
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r6, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @ilyalesokhin-starkware)
No description provided.